﻿using System.Windows.Forms;
using SharpDX;
using System.IO;
using ProtoBuf;

namespace Engine
{
    /// <summary>
    /// Класс источника света с тенями
    /// </summary>
    [ProtoContract]
    public class EELightShadow : EELight, System.IDisposable
    {
        #region IDisposable
        ~EELightShadow()
        {
            Dispose();
        }
        public void Dispose()
        {
            if (SCamera != null)
            {
                SCamera.Dispose();
            }
        }
        #endregion

        public EEShadowCamera SCamera;

        public override bool Shadow() { return true; }

        [ProtoMember(1)]
        public bool CastShadow = true;
        [ProtoMember(2)]
        public Matrix VM0;
        [ProtoMember(3)]
        public Matrix VM1;
        [ProtoMember(4)]
        public Matrix VM2;
        [ProtoMember(5)]
        public Matrix VM3;

        public EELightShadow(DVector3 Position, Vector3 Color)
        {
            this.Position = Position;
            this.Color = Color;
            SCamera = new EEShadowCamera(1f, 1000f);
        }

        public EELightShadow()
        {
            SCamera = new EEShadowCamera(1f, 1000f);
        }
    }
}
